import FocusParentObj from "../Common/FocusParentObj";
import Fuse from "./Fuse";

//保险丝盒子
export default class FuseBox extends FocusParentObj {
    /** 保险丝root*/
    private fuseRoot: Laya.Sprite3D;
    /** 第三个保险丝*/
    private thirdFuse: Laya.Sprite3D;

    onStart() {
        super.Start();
        this.mowner = this.owner as Laya.Sprite3D;
        this.fuseRoot = this.mowner.getChildByName("fuses") as Laya.Sprite3D;
        this.thirdFuse = this.fuseRoot.getChildByName("fuse3") as Laya.Sprite3D;
        let fuse = this.fuseRoot.getComponent(Fuse) as Fuse;
        fuse.SetData(this);
    }
    /** 是否装上了保险丝*/
    public IsOnFuse(): boolean {
        return this.thirdFuse.activeInHierarchy;
    }
    /** 装上保险丝*/
    public OnFuse() {
        this.thirdFuse.active = true;
    }
}